-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: container outputs and dynamic environments #591
Conversation
69e8a78
to
39973b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was doing some functional testing this morning and was not able to get it working with stages. i see the container being spun up, but it doesn't look like /vela/outputs/.env is being injected. i can cat
it, of course.
that's not an intentional limitation, right? didn't see anything on that in the proposal or here anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a question/suggestion
friendly reminder to also add an accompanying docs PR :D |
@@ -185,6 +185,17 @@ func WithVersion(version string) Opt { | |||
} | |||
} | |||
|
|||
func WithOutputCtn(ctn *pipeline.Container) Opt { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func WithOutputCtn(ctn *pipeline.Container) Opt { | |
// WithOutputCtn sets the outputs container in the executor client for Linux. | |
func WithOutputCtn(ctn *pipeline.Container) Opt { |
return nil | ||
} | ||
|
||
// update engine logger with secret metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// update engine logger with secret metadata | |
// update engine logger |
love it. |
I will open up a follow up issue for this. And for the comments I will open up a follow up PR shortly |
This PR introduces dynamic environments using a sidecar outputs container.
Proposal ref: go-vela/community#988
Outputs Container Image
When not set, the build will proceed just as it does today, making this feature completely opt-in and easy to turn off.
The input for
VELA_EXECUTOR_OUTPUTS_IMAGE
will be the image used for the sidecar container that is spun up next to the Vela build. At some point, this could expand to be a programmatic/plugin implementation rather than what it is in this PR — a sleeping container plugged into the volume that is polled after the conclusion of each step.In the
docker-compose.yml
, I decided to just go withalpine:latest
.Substitution and Injection relocation
This block has moved from
CreateStep
toExecBuild
for the Docker runtime and will now occur after polling the outputs container. This will allow for dynamic environments such as this:Updates to privileged image checking
To protect against dynamic invocations of privileged images using this new feature, parsing images to determine whether they should run will now be at runtime. The logic has moved from
AssembleBuild
toExecStep
/ExecService
.Unfortunately this means that builds will run up until that step is set to execute before denying it, which is a slightly worse UX but I think the tradeoff is worth it.